package com.dk.util;

import lombok.Setter;
import lombok.experimental.Accessors;

import java.awt.*;

import static java.awt.GridBagConstraints.*;

/**
 * @author: A11181121050450
 * @date: 2020-04-02 11:07
 */
@Setter
@Accessors(chain = true)
public class GBCUtil {
    public int gridx;

    public int gridy;

    public int gridwidth;

    public int gridheight;

    public double weightx;

    public double weighty;

    public int anchor;

    public int fill;

    public Insets insets;

    public int ipadx;

    public int ipady;
    private GBCUtil(){
        gridx = RELATIVE;
        gridy = RELATIVE;
        gridwidth = 1;
        gridheight = 1;

        weightx = 0;
        weighty = 0;
        anchor = CENTER;
        fill = NONE;

        insets = new Insets(0, 0, 0, 0);
        ipadx = 2;
        ipady = 2;
    }
    public static GBCUtil create(){
        return new GBCUtil();
    }
    public GridBagConstraints build(){
        GridBagConstraints result = new GridBagConstraints(
                this.gridx,this.gridy,this.gridwidth,this.gridheight,
                this.weightx,this.weighty,this.anchor,this.fill,
                this.insets,this.ipadx,this.ipady
        );
        return result;
    }
}
